import request from '@/utils/request'

/**
 *   status        设备状态
 *   code          设备编号
 *   name:         设备名称
 *   type          设备型号
 *   original      设备原值
 *   btime:        采购时间
 *   cumulative    累计使用时长
 *   pic           设备图片
 *
 */
export const equipmentAdd = data => {
    return request({
        url: '/equipment/add',
        method: 'POST',
        data
    })
}


export const listAllEquipments = params => {
    return request({
        url: '/equipment/listall',
        method: 'GET',
        params
    })
}



/**
 *  列出所有设备列表
 */
export const listEquipments = params => {
    return request({
        url: '/equipment/list',
        method: 'GET',
        params
    })
}
export const countTimeList = params => {
    return request({
        url: '/equipment/countTime',
        method: 'GET',
        params
    })
}

/**
 * 删除
 * */

export const delEquipmentById = data => {
    return request({
        url: '/equipment/del',
        method: 'POST',
        data
    })
}


export const editEquipmentById = data => {
    return request({
        url: '/equipment/update',
        method: 'POST',
        data
    })
}



